<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        body {
            background: url(images/1.png) no-repeat center top;
            background-size: 100% auto;
        }
        .box {
            overflow: hidden;
            width: 400px;
            height: 100px;
            margin: 200px auto;
        }
        ul li {
            list-style: none;
            float: left;
            width: 25%;
            height: 100px;
            
        }
        .box ul li img {
            width: 100%;
            height: 100%;
        }
    </style>
</head>
<body>
   <div class="box">
    <ul>
        <li><img src="images/1.png" alt=""></li>
        <li><img src="images/2.png" alt=""></li>
        <li><img src="images/3.png" alt=""></li>
        <li><img src="images/4.png" alt=""></li>
    </ul>
   </div>
   <script>
        var imgs = document.querySelector('.box').querySelectorAll('img');
        
            for (var i = 0; i < imgs.length; i++) {
               imgs[i].onclick = function() {
                    document.body.style.backgroundImage = 'url('+this.src+')'
               }
            }
        
   </script>
</body>
</html>